-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use upstream spf13 cobra #642
Conversation
Use upstream isntead of fork for cobra. Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Codecov Report
@@ Coverage Diff @@
## master #642 +/- ##
=========================================
- Coverage 49.4% 49.4% -0.01%
=========================================
Files 208 208
Lines 17190 17194 +4
=========================================
+ Hits 8493 8494 +1
- Misses 8264 8267 +3
Partials 433 433 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just don't change any of the keys our Liquid templates rely on. 👼
@@ -8,6 +8,7 @@ Flags: | |||
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s) | |||
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s) | |||
--external-ca external-ca Specifications of one or more certificate signing endpoints | |||
-h, --help help for update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes, think we previously special-cased -h /
--help` and hid it, because using that flag will print the same information as is being printed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, I think we might have been relying on a side-effect of an issue that was fixed in cobra to hide this flag, after we migrated to cobra. I think we can restore the old behaviour by hiding this flag. I'll try it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit, but LGTM
@@ -97,9 +98,19 @@ func managementSubCommands(cmd *cobra.Command) []*cobra.Command { | |||
return cmds | |||
} | |||
|
|||
// UseLine returns the usage line for a command. This implementation is different | |||
// from the default Command.UseLine in that it does not add a `[flags]` to the | |||
// of the line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed a word here "to the ..... of the line"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
spf13/cobra
finally merged all my PRs! So we can use upstream again.I think the man generation check might fail because the new
UseLine
adds an unnecessary[flags]
after the command. I was able to work around that for the yaml docs and help text, but I'll need to submit another patch to cobra to fix it for the man pages.